// Interpreter.h
// Define class Interpreter
#ifndef INTERPRETER_H
#define INTERPRETER_H

#include "crossbit/common.h"
#include "crossbit/ProcessorState.h"
#include "crossbit/VBlockBuilder.h"
#include "crossbit/ShadowPage.h"

namespace crossbit {

				class Interpreter {
								public:
												Interpreter( ProcessorState *state, ShadowPage *sp )
												{
														interp_state = state;
														shadow_page = sp;
												}

												virtual ~Interpreter() {}

												// Decode the instruction beginning at "addr", add VInst to
												//   block builder "bb".
												// Return the _SPC_ of next instruction.
												virtual XTMemAddr decode (XTMemAddr addr, VBlockBuilder *bb) = 0;

												// Initialization
												virtual XTInt32 initStack(XTMemAddr sp) = 0;
												ProcessorState* get_state( void ) { return interp_state; }
								protected:

												ProcessorState* interp_state;

												ShadowPage *shadow_page;
				};
}

#endif
